package com.itlong.cloud.wechat.resource;

import com.itlong.cloud.POJO.DTO.common.WeChatVisitorMsgDTO;
import com.itlong.cloud.iottp.IWeChatTemplateMsgServiceClient;
import com.itlong.cloud.wechat.service.IWeChatTemplateMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <desc>
 *      微信模板消息暴露接口实现类
 * </desc>
 *
 * @createDate 2019/04/26
 */
@RestController
public class WeChatTemplateMsgServiceResource implements IWeChatTemplateMsgServiceClient {

    @Autowired
    private IWeChatTemplateMsgService iWeChatTemplateMsgService;

    /**
     * <desc>
     *      发送微信公众号模板消息，目前业务为写字楼访客预约相关
     * </desc>
     *
     * @param weChatVisitorMsgDTO 访客预约流程发送微信公众号模板消息DTO
     * @author wangzhi
     * @createDate 2019/04/26
     */
    @Override
    @PostMapping(path = "/iotTp/weChat/sendWeChatTemplateMsg")
    public void sendWeChatTemplateMsg(@RequestBody WeChatVisitorMsgDTO weChatVisitorMsgDTO) throws Exception {
        iWeChatTemplateMsgService.sendWeChatTemplateMsg(weChatVisitorMsgDTO);
    }
}
